<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>供需对接服务系统--项目（内部）编辑页面</title>
	<!--公用样式-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
	<!--页面样式-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
	<!--Layui-->
	<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
	<!--extended-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
	<!--公用样式JS-->
	<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
	<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>

	<script type="text/javascript" src="${re.contextPath}/plugin/supplier/common/js/tel.js" charset="utf-8"></script>
</head>
<style>
	.Right {
		width: 100%;
		overflow-y: scroll;
	}

	.release ul:nth-child(2) li label {
		width: 28%;
	}

	.release ul:first-child li label {
		width: 23%;
	}

	.release .address, .personnel .address {
		width: 65%;
	}

</style>

<body>
<!--头部-->
<header class="whitebg"></header>
<!--容器-->
<div class="container clearfix">
	<!--占位-->
	<!--右侧内容-->
	<div class="Right fr mt50">
		<form class="layui-form" id="myForm" style="margin-left: 20px;    margin-bottom: 50px;">
			<div class="release">
				<ul class="clearfix whitebg">
					<li class="clearfix">


						<label class="fl">发布单位<span class="red">*</span> </label>
						<input type="text" value="${comName}"  style="width: 70%;"
								<#if "${project.status}" != "001">
									readonly="readonly"
								</#if>
						>
						<input type="hidden"  id = "supProjectId" name="supProjectId" value="${project.supProjectId}">
						<input type="hidden" class="fl" id="publishCompany" name="publishCompany" lay-maxlength="30"
							   value="${project.publishCompany}"
							   lay-verify="notnull|maxlength">

						<input type="hidden" name="oaId" id="oaId" value="${project.oaId}">
						<input type="hidden" name="jlHtName" id="jlHtName"  value="${project.jlHtName}">
					</li>
					<li class="clearfix">
						<label class="fl">发布人<span class="red">*</span> </label>
						<input type="text" class="fl" id="publishBy"  value="${project.publishByName}"
								<#if "${project.status}" != "001">
									readonly="readonly"
								</#if>
						>
						<input type="hidden" class="fl" id="publishBy" name="publishBy"  value="${project.publishBy}">
					</li>
					<li class="clearfix">
						<label class="fl">联系电话<span class="red">*</span> </label>
						<input type="text" name="linkTel" id="linkTel" lay-verify="notnull|phoneNumber"  value="${project.linkTel}">
					</li>
				</ul>
				<ul class="clearfix whitebg mt20">
					<li class="clearfix">
						<label class="fl">项目名称<span class="red">*</span> </label>
						<input type="text" class="fl" id="projectName" name="projectName" lay-maxlength="200" value="${project.projectName}"
								<#if "${project.status}" != "001">
									readonly="readonly"
								</#if>
							   lay-verify="notnull|maxlength">
					</li>
					<li class="clearfix">
						<label class="fl">项目类型<span class="red">*</span> </label>
						<div class="category clearfix  xmlxdiv">
							<#list projectTypeList as vo>
								<#if "${project.projectType}"?contains("${vo.badtCode}")>
									<input type="checkbox" class="fl h15 w25 "
									<#if "${project.status}" != "001">
										disabled = disabled
									</#if>
										   name="projectType${vo_index}" value="${vo.badtCode}" onchange="_crt_page.events.xmlxChange(this)" checked  lay-ignore >
								<#else >
									<input type="checkbox" class="fl h15 w25 "
											<#if "${project.status}" != "001">
												disabled = disabled
											</#if>
										   name="projectType${vo_index}" value="${vo.badtCode}" onchange="_crt_page.events.xmlxChange(this)"  lay-ignore >
								</#if>
								<span class="fl mr10" >${vo.badtName}</span>
							</#list>
						</div>
					</li>
					<li class="clearfix">
						<label class="fl">项目建设总投资<span class="red">*</span></label>
						<input type="text" class="fl unit-ind-1" name="tzMoney"
								<#if "${project.status}" != "001">
									readonly="readonly"
								</#if>
							   value="${project.tzMoney}" id="tzMoney" lay-maxlength="20"
							   lay-verify="required|decimal|maxlength">
						<span class="fl ml10">元</span>
					</li>
					<li class="clearfix">
						<label class="fl">合同金额<span class="red">*</span></label>
						<input type="text" class="fl unit-ind-1" name="htMoney" id="htMoney" lay-maxlength="20"  value="${project.htMoney}"
							   lay-verify="required|decimal|maxlength">
						<span class="fl ml10">元</span>
					</li>
						<li class="clearfix lx001">
							<label class="fl"  style="width: 20%;">监理方式</label>
							<select class="fl" id="supervisorWay" name="supervisorWay" lay-ignore>
								<option value="">请选择</option>
								<#list checkShapeList as csl>
									<option value="${csl.badtCode}"
											<#if (project.supervisorWay)??>
												<#if (project.supervisorWay) ==(csl.badtCode) >
													selected=selected
												</#if>
											</#if>
									>${csl.badtName}</option>
								</#list>
							</select>
						</li>
						<li class="clearfix lx001">
								<label class="fl">监理服务费<span class="red">*</span></label>
								<input type="text" class="fl unit-ind-1" name="jlFwMoney" id="jlFwMoney" lay-maxlength="20" lay-verify="required|decimal|maxlength" value="${project.jlFwMoney}"
									   onblur="_crt_page.events.ssfybulur(this)">
								<span class="fl ml10">元</span>
						</li>
						<li class="clearfix lx001">
								<label class="fl">监理实施费用<span class="red">*</span></label>
								<input type="text" class="fl unit-ind-1" name="jlSsMoney" id="jlSsMoney" lay-maxlength="20" lay-verify="required|decimal|maxlength" value="${project.jlSsMoney}"  readonly="readonly" >

								<span class="fl ml10">元</span>
						</li>
						<li class="clearfix lx002 ">
							<label class="fl">咨询服务费<span class="red">*</span></label>
							<input type="text"  class="fl unit-ind-1" name="zxFwMoney" id="zxFwMoney" lay-maxlength="20" value="${project.zxFwMoney}"
								   onblur="_crt_page.events.ssfybulur(this)">
							<span class="fl ml10">元</span>
						</li>
						<li class="clearfix lx002 " >
							<label class="fl">咨询实施费用<span class="red">*</span></label>
							<input type="text" class="fl unit-ind-1" name="zxSsMoney" id="zxSsMoney" lay-maxlength="20" value="${project.zxSsMoney}" readonly="readonly"
							>
							<span class="fl ml10">元</span>
						</li>
						<li class="clearfix lx003 ">
							<label class="fl">检测服务费<span class="red">*</span></label>
							<input type="text" class="fl unit-ind-1" name="jcFwMoney" id="jcFwMoney" lay-maxlength="20" value="${project.jcFwMoney}"
								   onblur="_crt_page.events.ssfybulur(this)">
							<span class="fl ml10">元</span>
						</li>
						<li class="clearfix lx003 ">
							<label class="fl">检测实施费用<span class="red">*</span></label>
							<input type="text" class="fl unit-ind-1" name="jcSsMoney" id="jcSsMoney" lay-maxlength="20"  value="${project.jcSsMoney}" readonly="readonly"
							>
							<span class="fl ml10">元</span>
						</li>

						<li class="clearfix lx100 ">
							<label class="fl">其他服务费<span class="red">*</span></label>
							<input type="text" class="fl unit-ind-1" name="qtFwMoney" id="qtFwMoney" lay-maxlength="20"  value="${project.qtFwMoney}"
								   onblur="_crt_page.events.ssfybulur(this)">
							<span class="fl ml10">元</span>
						</li>
						<li class="clearfix lx100 hide">
							<label class="fl">其他实施费用<span class="red">*</span></label>
							<input type="text" class="fl unit-ind-1" name="qtSsMoney" id="qtSsMoney" lay-maxlength="20"  value="${project.qtSsMoney}" readonly="readonly"
								   lay-verify="">
							<span class="fl ml10">元</span>
						</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">无人应接<span class="red">*</span></label>
						<input type="text" class="fl unit-ind-1" name="days" id="days" value="${project.days}"
							   lay-verify="required|decimalDay">
						<span class="fl ml10">天增加费用</span>
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">公示天数<span class="red">*</span></label>
						<input type="text" class="fl unit-ind-1" name="gsDays" id="gsDays"value="${project.gsDays}"
							   lay-verify="required|decimalDay">
						<span class="fl ml10">天</span>
					</li>
					<#-- ============================================================================================-->
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">合同编号</label>
						<input type="text" class="fl unit-ind-1" name="contractNo" id="contractNo" value="${project.contractNo}">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">内部合同编号<span class="red">*</span></label>
						<input type="text" class="fl unit-ind-1" name="insideContractNo" id="insideContractNo" value="${project.insideContractNo}" lay-verify="required">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">采购/项目编号</label>
						<input type="text" class="fl unit-ind-1" name="payOrProjectNo" id="payOrProjectNo" value="${project.payOrProjectNo}">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">客户名称<span class="red">*</span></label>
						<input type="text" class="fl unit-ind-1" name="owerCompany" id="owerCompany" lay-verify="required" value="${project.owerCompany}">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">客户联系人</label>
						<input type="text" class="fl unit-ind-1" name="projectLeader" id="projectLeader" value="${project.projectLeader}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">联系人电话</label>
						<input type="text" class="fl unit-ind-1" name="khlxrPhone" id="khlxrPhone" value="${project.khlxrPhone}">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">联系人邮箱</label>
						<input type="text" class="fl unit-ind-1" name="khlxrEmail" id="khlxrEmail" value="${project.khlxrEmail}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">联系人职务</label>
						<input type="text" class="fl unit-ind-1" name="duty" id="duty" value="${project.duty}">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">中标信息查询网址</label>
						<input type="text" class="fl unit-ind-1" name="queryWeb" id="queryWeb" value="${project.queryWeb}">
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">项目归属<span class="red">*</span></label>
						<select class="fl" id="projectOwner" name="projectOwner" lay-verify="required" lay-ignore>
							<option value="">请选择</option>
							<#list comlistOwner as vo>
								<option value="${vo.bcId}"
										<#if (project.projectOwner)??>
											<#if (project.projectOwner) ==(vo.bcId) >
												selected=selected
											</#if>
										</#if>
								>${vo.bcName}</option>
							</#list>
						</select>
					</li>
					<#-- ============================================================================================-->
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">项目范围</label>
						<input type="text" class="fl unit-ind-1" name="projectScope" id="projectScope" value="${project.projectScope}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">项目预算</label>
						<input type="text" class="fl unit-ind-1" name="projectYs" id="projectYs" value="${project.projectYs}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">付款条件</label>
						<input type="text" class="fl unit-ind-1" name="paymentClause" id="paymentClause" value="${project.paymentClause}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">承诺(口头)</label>
						<input type="text" class="fl unit-ind-1" name="ktcn" id="ktcn" value="${project.ktcn}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">人数沟通</label>
						<input type="text" class="fl unit-ind-1" name="rsgt" id="rsgt" value="${project.rsgt}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">质保期长</label>
						<input type="text" class="fl unit-ind-1" name="zbq" id="zbq" value="${project.zbq}">
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">预计进场时间</label>
						<input type="text" class="fl" style="width: 50%;" autocomplete="off" placeholder="选择引见时间" value="${project.ydyjjcTime}" name="ydyjjcTime" id="ydyjjcTime"/>
					</li>

					<li class="clearfix">
						<label class="fl"  style="width: 28%;">引见时间</label>
						<input type="text" class="fl" style="width: 50%;" autocomplete="off" placeholder="选择引见时间" value="${project.yjTime}" name="yjTime" id="yjTime"/>
					</li>
					<li class="clearfix">
						<label class="fl"  style="width: 28%;">工期</label>
						<input type="text" class="fl unit-ind-1" name="gqReq" id="gqReq" value="${project.gqReq}"   >

<#--						<span class="fl ml10">月</span>-->
					</li>
					<li class="clearfix">
						<label class="fl">招标截止时间<span class="red">*</span></label>
						<input type="text" class="fl" style="width: 50%;" name="zbEndDate" placeholder="选择时间" lay-verify="required" value="${project.zbEndDate}"
							   autocomplete="off" id="zbEndDate" lay-verify="zbEndDate">
					</li>
					<li class="clearfix">
						<label class="fl">合同签订地<span class="red">*</span></label>
						<select name="htSignProvince" class="ml8" id="htSignProvince" style="width:90px !important;"  onchange="_crt_page.events.provinceChange(this)"
								lay-verify="required" lay-ignore>
							<option value="">请选择</option>
							<#list provincelist as vo>
								<option value="${vo.code}"
										<#if (project.htSignProvince)??>
											<#if (project.htSignProvince) ==(vo.code) >
												selected=selected
											</#if>
										</#if>
								>${vo.name}</option>
							</#list>
						</select>


						<select name="htSignCity" id="htsigncity" class="ml8" lay-verify="required" onchange="_crt_page.events.cityChange(this)"
								style="width: 90px !important;margin-left: 10px" lay-ignore>
							<option value="">请选择</option>
							<#list citylist as vo>
								<option value="${vo.code}"
											<#if "${project.htSignCity}" =="${vo.code}" >
												selected=selected
											</#if>
								>${vo.name}</option>
							</#list>
						</select>
						<select name="htSignCounty" id="htsigncounty" class="ml8" lay-filter="htsigncounty" lay-verify="required"
								style="width:90px !important;margin-left: 10px" lay-ignore>
							<option value="">请选择</option>
							<#list countylist as vo>
								<option value="${vo.code}"
										<#if "${project.htSignCounty}" =="${vo.code}" >
											selected=selected
										</#if>
								>${vo.name}</option>
							</#list>
						</select>
					</li>
					<li class="clearfix">
						<label class="fl">行业类型<span class="red">*</span></label>
						<select class="fl" id="hyType" name="hyType" lay-verify="required" lay-ignore>
							<option value="">请选择</option>
							<#list hytypelist as vo>
								<option value="${vo.badtCode}"
										<#if "${project.hyType}" =="${vo.badtCode}" >
											selected=selected
										</#if>
								>${vo.badtName}</option>
							</#list>
						</select>
					</li>
					<li class="clearfix" style="width: 50%;">
						<label class="fl" style="width: 28%;">实施地点</label>
						<div class="address fl clearfix ssplace">
							<#list  listpalce  as place >
								<div class="clearfix mt10 divplaceselect">
									<select name="projectPlacedtos[${place_index}].province" class="ml8 fl" id="placeprovince0" onchange="_crt_page.events.provinceChange(this)" style="width:90px !important;"
											lay-ignore>
										<option value="">请选择</option>
										<#list provincelist as vo>
											<option value="${vo.code}"
											<#if "${place.province}"=="${vo.code}">
												selected
											</#if>
											>${vo.name}</option>
										</#list>
									</select>
									<select name="projectPlacedtos[${place_index}].city" id="placecity0" class="ml8 fl" lay-filter="city" onchange="_crt_page.events.cityChange(this)"
											style="width: 90px !important;margin-left: 10px" lay-ignore>
										<option value="">请选择</option>
										<#list place.citys as vocity>
											<option value="${vocity.code}"
												<#if "${place.city}"=="${vocity.code}">
														selected
												</#if>
											>${vocity.name}</option>
										</#list>
									</select>
									<select name="projectPlacedtos[${place_index}].county" id="placecounty0" class="ml8 fl" lay-filter="county"
											style="width:90px !important;margin-left: 10px" lay-ignore>
										<option value="">请选择</option>
										<#list place.countys as vocounty>
											<option value="${vocounty.code}"
													<#if "${place.county}"=="${vocounty.code}">
														selected
													</#if>
											>${vocounty.name}</option>
										</#list>
									</select>
									<img src="${re.contextPath}/plugin/common/images/77@2x.png" class="fl ml20 addplaceimage" onclick="_crt_page.events.addPlace(this)" >
									<img src="${re.contextPath}/plugin/common/images/76@2x.png" class="fl ml20" onclick="_crt_page.events.deletePlace(this)">
								</div>
							</#list>
						</div>
					</li>
					<li class="clearfix divisgk" style="width: 40%;">
						<label class="fl">是否对外公开<span class="red">*</span></label>
						<div class="category clearfix ">
							<input type="radio" class="fl h15 w25 "
									<#if "${project.isGk}"=="1">
										checked
									</#if>
								   name="isGk" value="1"  lay-verify="required"   lay-ignore >
							<span class="fl mr10">是</span>
							<input type="radio" class="fl h15 w25 "
									<#if "${project.isGk}"=="0">
										checked
									</#if>
								   name="isGk" value="0"   lay-verify="required"  lay-ignore >
							<span class="fl mr10" >否</span>
						</div>
					</li>
					<li class="clearfix divneedzb" style="width: 60%;">
						<label class="fl">是否需要招投标<span class="red">*</span></label>
						<div class="category clearfix">
							<input type="radio" class="fl h15 w25 " name="needZb" value="1"
								   <#if "${project.needZb}"=="1">
									   checked
								   </#if>
								   onchange="_crt_page.events.needZtbChange(this)"   lay-ignore >
							<span class="fl mr10">是</span>
							<input type="radio" class="fl h15 w25 " name="needZb" value="0"
									<#if "${project.needZb}"=="0">
										checked
									</#if>
								   onchange="_crt_page.events.needZtbChange(this)"  lay-ignore >
							<span class="fl mr10" >否</span>
						</div>
					</li>
					<li class="clearfix  LIisZb" style="width: 60%;
					<#if "${project.needZb}"=="0">
							display: none;
					</#if>
">
						<label class="fl">是否已招标<span class="red">*</span></label>
						<div class="category clearfix">
							<input type="radio" class="fl h15 w25 " name="isZb" value="1"
									<#if "${project.isZb}"=="1">
										checked
									</#if>
								   onchange="_crt_page.events.isZbChange(this)"  lay-ignore >
							<span class="fl mr10">是</span>
							<input type="radio" class="fl h15 w25 " name="isZb" value="0"
									<#if "${project.isZb}"=="0">
										checked
									</#if>
								   onchange="_crt_page.events.isZbChange(this)" lay-ignore >
							<span class="fl mr10" >否</span>
						</div>
					</li>
					<li class="clearfix  LIqdHt" style="width: 60%;">
						<label class="fl">是否已签合同<span class="red">*</span></label>
						<div class="category clearfix">
							<input type="radio" class="fl h15 w25 " name="qdHt" value="1"
									<#if "${project.isZb}"=="0">
										disabled = disabled
									</#if>
									<#if "${project.qdHt}"=="1" >
										checked
									</#if>
								   onchange="_crt_page.events.qdHtChange(this)"  lay-ignore >
							<span class="fl mr10">是</span>
							<input type="radio" class="fl h15 w25 " name="qdHt" value="0"
									<#if "${project.isZb}"=="0">
									disabled = disabled
									</#if>
									<#if "${project.qdHt}"=="0" || "${project.isZb}"=="0">
										checked
									</#if>
								   onchange="_crt_page.events.qdHtChange(this)"  lay-ignore >
							<span class="fl mr10" >否</span>
						</div>
					</li>
					<li class="clearfix  sfk" style="width:60%;
					<#if "${project.qdHt}"=="0" || "${project.isZb}"=="0">
							display: none;
					</#if>
">
						<label class="fl">是否有首付款<span class="red">*</span></label>
						<div class="category clearfix">
							<input type="radio" class="fl h15 w25 " name="isSfk" value="1"
									<#if "${project.isSfk}"=="1"  >
										checked
									</#if>
								   lay-ignore >
							<span class="fl mr10">是</span>
							<input type="radio" class="fl h15 w25 " name="isSfk" value="0"    lay-ignore
									<#if "${project.isSfk}"=="0">
										checked
									</#if>
							>
							<span class="fl mr10" >否</span>
						</div>
					</li>
					<li class="clearfix  htqdhj"
							<#if "${project.qdHt}"=="0" || "${project.isZb}"=="0">
								style="display: none;"
							</#if>
					>
						<label class="fl">合同签订时间<span class="red">*</span></label>
						<input type="text" class="fl" style="width: 50%;" name="htSignDate" placeholder="选择时间"
							   autocomplete="off" id="htSignDate"
							   <#if "${project.qdHt}"=="1">
								   lay-verify="required"
							   </#if>
							   value="${project.htSignDate}">
					</li>
					<li class="clearfix">
						<label class="fl">其他需求</label>
						<textarea id="otherXq" name="otherXq" autocomplete="off" placeholder="请输入其他要求，输入内容最大200个汉字"
								  lay-maxlength="200" lay-verify="maxlength">${project.otherXq}</textarea>
					</li>
				</ul>
			</div>
			<div class="personnel whitebg">
				<div class="bold">主要负责人要求</div>
				<ul>
					<li class="clearfix">
						<label class="fl">性别：</label>
						<select name="mainFzSex"  id="mainFzSex"  class="fl"  lay-ignore>
								<option value="0"
								<#if "${project.mainFzSex}"=="0">selected</#if>
								>女
								</option>
							    <option value="1"
							    <#if "${project.mainFzSex}"=="1">selected</#if>
								>男
								</option>
						    	<option value=""
								<#if "${project.mainFzSex}"=="">selected</#if>
								>不限
								</option>
						</select>
					</li>
					<li class="clearfix">
						<label class="fl">学历：</label>
						<select name="mainFzXl" id="mainFzXl"   class="fl"  lay-ignore>
							<option value="" selected>不限</option>
							<#list edulist as vo>
								<option value="${vo.badtCode}"
								<#if "${project.mainFzXl}"=="${vo.badtCode}">
										selected
								</#if>
								>${vo.badtName}</option>
							</#list>
						</select>
					</li>
					<li class="clearfix">
						<label class="fl">地区：</label>
						<div class="address fl clearfix mainpersonplace">
							<#if (listperpalce?size>0)  >
							<#list  listperpalce  as place >
								<div class="clearfix mt10 divpersonplaceselect">

										<select name="personPlacedtos[${place_index}].province" class="ml8 fl" id="personplaceprovince0" style="width:200px !important;" onchange="_crt_page.events.provinceChange(this)"
												lay-ignore>
											<option value="">请选择</option>
											<#list provincelist as vo>
												<option value="${vo.code}"
														<#if "${place.province}"=="${vo.code}">
															selected
														</#if>
												>${vo.name}</option>
											</#list>
										</select>
										<select name="personPlacedtos[${place_index}].city" id="personplacecity0" class="ml8 fl" lay-filter="city"
												style="width: 200px !important;margin-left: 10px" lay-ignore>
											<option value="">请选择</option>
											<#list place.citys as vocity>
												<option value="${vocity.code}"
														<#if "${place.city}"=="${vocity.code}">
															selected
														</#if>
												>${vocity.name}</option>
											</#list>
										</select>
										<img src="${re.contextPath}/plugin/common/images/77@2x.png" class="fl ml20" onclick="_crt_page.events.addPersonPlace(this)">
										<img src="${re.contextPath}/plugin/common/images/76@2x.png" class="fl ml20" onclick="_crt_page.events.deletePersonPlace(this)">



								</div>

							</#list>
							<#else >

								<select name="personPlacedtos[0].province" class="ml8 fl" id="personplaceprovince0" style="width:200px !important;" onchange="_crt_page.events.provinceChange(this)"
										lay-ignore>
									<option value="">请选择</option>
									<#list provincelist as vo>
										<option value="${vo.code}">${vo.name}</option>
									</#list>
								</select>
								<select name="personPlacedtos[0].city" id="personplacecity0" class="ml8 fl" lay-filter="city"
										style="width: 200px !important;margin-left: 10px" lay-ignore>
									<option value="">请选择</option>
								</select>
								<img src="${re.contextPath}/plugin/common/images/77@2x.png" class="fl ml20" onclick="_crt_page.events.addPersonPlace(this)">
								<img src="${re.contextPath}/plugin/common/images/76@2x.png" class="fl ml20" onclick="_crt_page.events.deletePersonPlace(this)">


							</#if>
						</div>
					</li>
					<li class="clearfix">
						<label class="fl">擅长领域：</label>
						<div class="category clearfix fl">
							<#list doBestList as vo>
								<div style="display: inline-block">
									<input type="checkbox" class="fl h15 w25 doBestInput" name="mainFzField" value="${vo.badtCode}"  lay-ignore
									<#if "${project.mainFzField}"?contains("${vo.badtCode}")>
										checked
									</#if>
									>
									<span class="fl mr10" >${vo.badtName}</span>
								</div>
							</#list>
						</div>
					</li>
					<li class="clearfix">
						<label class="fl">需要出差：</label>
						<select name="mainFzTrip" id="mainFzTrip" class="fl" lay-ignore>
							<option value="0"
							<#if "${project.mainFzTrip}"=="0">
								selected
							</#if>
							>否
							</option>
							<option value="1"
							<#if "${project.mainFzTrip}"=="1">
										selected
							</#if>
							>是
							</option>
						</select>
					</li>
					<li class="clearfix">
						<label class="fl" class="fl">备注：</label>
						<textarea id="mainFzRemark" name="mainFzRemark" autocomplete="off" placeholder="请输入备注,输入内容最大200个汉字"
								  lay-maxlength="200" lay-verify="maxlength">${project.mainFzRemark}</textarea>
					</li>
				</ul>
			</div>
			<div class="downModule whitebg mt30">

				<ul>
					<li  class="uploadli upload_zbwjsmw_li
					<#if "${zbsmfile}"!=true>
							 hide
					</#if>
                      ">
						<div class="clearfix upload_oper_div">
							<div class="downModuleTip clearfix fl">

								<span class="fl mt10"><strong>上传项目招标文件说明文件</strong>(项目招标说明文件上传的文件名称必须包含“招标“和”说明”字样)</span>
							</div>
							<div class="downModuleBtn clearfix fr">
								<img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"  filedata="{'type':'311','projectType':'002'}" alt="" class="fl">
								<img src="${re.contextPath}/plugin/common/images/19@2x.png" alt="" onclick="_crt_page.events.delFile(this)"  class="fl">
<#--								<button class="fl bluebg white fl ml20 upfinish"   type="button" lay-ignore="" onclick="_crt_page.events.finishfile(this)">完成</button>-->
							</div>
						</div>
						<ul>
							<#list filelist  as vo  >
								<#if "${vo.type}"=="311" >
									<li class=" clearfix"   >
										<input type="checkbox" class="fl"  value="${vo.id}" style="display:inline-block;" lay-ignore  >
										<span class="fl ml10">
											<span id="${vo.id}" class="cursor" url="${vo.url}" onclick="_crt_file.events.viewFile(this)">${vo.fileName}</span>
										</span>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
					<li  class="uploadli upload_zbwj_li
						<#if "${zbfile}"!=true>
							 hide
					    </#if>
                      ">
						<div class="clearfix upload_oper_div">
							<div class="downModuleTip clearfix fl">

								<span class="fl mt10"><strong>上传项目招标文件</strong>(项目招标文件上传的文件名称必须包含“招标”字样)</span>
							</div>
							<div class="downModuleBtn clearfix fr">
								<img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"  filedata="{'type':'312','projectType':'002'}" alt="" class="fl">
								<img src="${re.contextPath}/plugin/common/images/19@2x.png" alt=""onclick="_crt_page.events.delFile(this)"  class="fl">
			<#--					<button class="fl bluebg white fl ml20 upfinish"  type="button" onclick="_crt_page.events.finishfile(this)">完成</button>-->
							</div>
						</div>
						<ul>
							<#list filelist  as vo  >
								<#if "${vo.type}"=="312" >
									<li class="clearfix"   >
										<input type="checkbox" class="fl"  value="${vo.id}" style="display:inline-block;" lay-ignore  >
										<span class="fl ml10">
											<span id="${vo.id}" class="cursor" url="${vo.url}" onclick="_crt_file.events.viewFile(this)">${vo.fileName}</span>
										</span>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
					<li class="uploadli  upload_tbwj_li
						<#if "${tbfile}"!=true>
							 hide
					    </#if>
                      ">
						<div class="clearfix upload_oper_div">
							<div class="downModuleTip clearfix fl">

								<span class="fl mt10"><strong>上传项目投标文件</strong>(项目投标文档上传的文件名称必须包含“投标”字样)</span>
							</div>
							<div class="downModuleBtn clearfix fr">
								<img src="${re.contextPath}/plugin/common/images/18@2x.png" class="file-upload fl"  filedata="{'type':'313','projectType':'002'}" alt="" class="fl">
								<img src="${re.contextPath}/plugin/common/images/19@2x.png" alt=""  onclick="_crt_page.events.delFile(this)"  class="fl">
<#--								<button class="fl bluebg white fl ml20 upfinish" type="button" onclick="_crt_page.events.finishfile(this)">完成</button>-->
							</div>
						</div>
						<ul>
							<#list filelist  as vo  >
								<#if "${vo.type}"=="313" >
									<li class="clearfix"  >
										<input type="checkbox" class="fl"  value="${vo.id}" style="display:inline-block;" lay-ignore  >
										<span class="fl ml10">
											<span id="${vo.id}" class="cursor" url="${vo.url}" onclick="_crt_file.events.viewFile(this)">${vo.fileName}</span>
										</span>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
					<li class="uploadli upload_ht_li
						<#if "${htfile}"!=true>
							 hide
					    </#if>
                        ">
						<div class="clearfix upload_oper_div">
							<div class="downModuleTip clearfix fl">

								<span class="fl mt10"><strong>上传合同</strong>(合同文件上传的文件名称必须包含“合同”字样，且为PDF格式)</span>
							</div>
							<div class="downModuleBtn clearfix fr">
								<img src="${re.contextPath}/plugin/common/images/18@2x.png"  class="file-upload fl"  filedata="{'type':'314','projectType':'002'}" alt="" class="fl">
								<img src="${re.contextPath}/plugin/common/images/19@2x.png" onclick="_crt_page.events.delFile(this)"  alt="" class="fl">
<#--								<button class="fl bluebg white fl ml20 upfinish"  type="button"onclick="_crt_page.events.finishfile(this)">完成</button>-->
							</div>
						</div>
						<ul>
							<#list filelist  as vo  >
								<#if "${vo.type}"=="314" >
									<li class="clearfix"   >
										<input type="checkbox" class="fl" value="${vo.id}"  style="display:inline-block;" lay-ignore  >
										<span class="fl ml10">${vo.fileName}</span>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
					<li class="uploadli  upload_htsmwj_li
						<#if "${htsmfile}"!=true>
							 hide
					    </#if>
                      ">
						<div class="clearfix upload_oper_div">
							<div class="downModuleTip clearfix fl">

								<span class="fl mt10"><strong>上传合同说明文件</strong>(合同说明文件上传的文件名称必须包含“合同"和"说明”字样)</span>
							</div>
							<div class="downModuleBtn clearfix fr">
								<img src="${re.contextPath}/plugin/common/images/18@2x.png"   class="file-upload fl"  filedata="{'type':'315','projectType':'002'}" alt="" class="fl">
								<img src="${re.contextPath}/plugin/common/images/19@2x.png" onclick="_crt_page.events.delFile(this)"   alt="" class="fl">
<#--								<button class="fl bluebg white fl ml20 upfinish" type="button" onclick="_crt_page.events.finishfile(this)">完成</button>-->
							</div>
						</div>
						<ul>
							<#list filelist  as vo  >
								<#if "${vo.type}"=="315" >
									<li class="clearfix  form-file-div-"${vo.type}   >
										<input type="checkbox" class="fl"  value="${vo.id}" style="display:inline-block;" lay-ignore  >
										<span class="fl ml10">
											<span id="${vo.id}" class="cursor" url="${vo.url}" onclick="_crt_file.events.viewFile(this)">${vo.fileName}</span>
										</span>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
					<li class="uploadli  upload_zbtzs_li
						<#if "${htzbtzs}"!=true>
							 hide
					    </#if>
                      ">
						<div class="clearfix upload_oper_div">
							<div class="downModuleTip clearfix fl">

								<span class="fl mt10"><strong>上传中标通知书(可选)</strong></span>
							</div>
							<div class="downModuleBtn clearfix fr">
								<img src="${re.contextPath}/plugin/common/images/18@2x.png"   class="file-upload fl"  filedata="{'type':'315','projectType':'002'}" alt="" class="fl">
								<img src="${re.contextPath}/plugin/common/images/19@2x.png" onclick="_crt_page.events.delFile(this)"   alt="" class="fl">
							</div>
						</div>
						<ul>
							<#list filelist  as vo  >
								<#if "${vo.type}"=="316" >
									<li class="clearfix"   >
										<input type="checkbox" class="fl" value="${vo.id}"  style="display:inline-block;" lay-ignore  >
										<span class="fl ml10">${vo.fileName}</span>
									</li>
								</#if>
							</#list>
						</ul>
					</li>
				</ul>
			</div>
			<div class="releaseBtn center">
				<button type="submit" lay-submit lay-filter="save"onclick="resetRequired()"
						 class="bluebg white ft18" id="btnsave">保存</button>
				<#if '${fix}'!='1'>
					<button type="submit" lay-submit lay-filter="submit" onclick="resetRequiredSubmit()"
							class="bluebg white ft18" id="btnsubmit">提交
					</button>
				</#if>
			</div>
		</form>

	</div>
</div>
<!--JQ-->
<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.boot.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.common.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<script type="text/javascript" src="${re.contextPath}/pageoffice.js" id="po_js_main"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/form.file.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/supplier/common/js/fileoper.js"></script>
<!-- 公共配置第三方组件 -->
<script type="text/javascript">
	layui.config({
		version: false,
		debug: false,
		base: "${re.contextPath}/plugin/layui/lay/extra/"
	})
</script>

<script>
	var layer, form, laydate, table, autocomplete;
	var _crt_page;
	layui.use(['form', 'laydate', 'layer', 'autocomplete'], function () {
		layer = layui.layer;
		form = layui.form;
		laydate = layui.laydate;

		$('.close').click(function () {
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index);
		});
		form.verify({
			maxlength: function (v,item) {

				var maxlength = item.getAttribute('lay-maxlength');
				if(v.trim()!=''){
					if(v.trim().length>maxlength){
						return "输入长度不能大于"+maxlength+"个字符！";
					}
				}
			},
			phoneNumber: function(v) {
				if (v.trim() == '') {
					return '手机号不能为空';
				} else {
					if (!v.trim().isMobile() && !v.trim().isTel()) {
						return '请输入正确的手机号码或电话号码\n\n例如:13916752109或0531-3614072';
					}
				}
			},
			number: function (v) {
				if (v.trim() == '') {
					return;
				}
				var reg = /^[0-9]*$/;
				var flag = reg.test(v.trim());
				if (!flag) {
					return '请输入正确的数字';
				}
			},
			decimalDay: function (v) {
				if (v.trim() == '') {
					return;
				}
				var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$/;
				var flag = reg.test(v.trim());
				if (!flag) {
					return '请输入正确的天数';
				}
			},
			decimal: function (v) {
				if (v.trim() == '') {
					return;
				}
				var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,10})?$/;
				var flag = reg.test(v.trim());
				if (!flag) {
					return '请输入正确的金额';
				}
			},
			perdecimal: function (v) {
				if (v.trim() == '') {
					return;
				}
				var reg = /^[1-9][0-9]*([.][0-9]+)?$/;
				var flag = reg.test(v.trim());
				if (!flag) {
					if(v.trim()!="0"  || v.trim()!=0){
						return '请输入数字';
					}
				}
			},
			required: function (v) {
				if("${project.status}" != "001"){
					if(v==""){
						return "必填项不能为空";
					}
				}
			},
			notnull: function (v, obj) {
				if (v == "") {
					var str = $(obj).prev().text()
					console.log(str)
					return str + "必填项不能为空";
				}
			}
		})
		_crt_page = {
			init: function () {
				//初始化事件
				_crt_page.events._init();
				//初始化Form
				form.on('submit(save)', _crt_page.forms.save);
				form.on('submit(submit)', _crt_page.forms.commit);
			},
			forms:{
				save:function(data) {
					$('#btnsave').addClass("layui-btn-disabled").attr("disabled",true);
					$('#btnsubmit').addClass("layui-btn-disabled").attr("disabled",true);
					var istg;
					if("${project.status}" == "001"){
						istg =_crt_page.events.saveBeforeBjy(data);
					}else{
						istg =_crt_page.events.saveBefore(data);
					}

					if(istg){
						var yj='${fix}';
						var  url='/supplier/projectManager/updateSave?flag=0';
						if(yj=='1'){
							url='/supplier/projectManager/updateSave?flag=0&yj=1';
						}
						if("${project.status}" != "001"){
							if(data.field.jlFwMoney && Number(data.field.jlFwMoney)<=0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('监理服务费金额不正确', {icon: 2});return false;
							}
							if(data.field.zxFwMoney && Number(data.field.zxFwMoney)<=0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('咨询服务费金额不正确', {icon: 2});return false;
							}
							if(data.field.jcFwMoney && Number(data.field.jcFwMoney)<=0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('检测服务费金额不正确', {icon: 2});return false;
							}
							if(data.field.qtFwMoney && Number(data.field.qtFwMoney)<=0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('其他服务费金额不正确', {icon: 2});return false;
							}
							if (data.field.tzMoney && Number(data.field.tzMoney)<0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('项目建设总投资金额不正确', {icon: 2});return false;
							}
							if (data.field.htMoney && Number(data.field.htMoney)<=0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('合同金额不正确', {icon: 2});return false;
							}
							var sum = data.field.htMoney;
							var fwMoney = Number(data.field.jlFwMoney) + Number(data.field.zxFwMoney) + Number(data.field.jcFwMoney) + Number(data.field.qtFwMoney);
							if (sum != fwMoney) {
								// console.log("合同金额："+sum+"服务金额："+fwMoney);
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg('请填写正确的合同金额，合同金额应该等于所有类型服务费之和', {icon: 2});return false;
							}
						}
						layerAjax(url, data.field, '', function (d) {
							console.log(data.field);
							if (d.flag == true) {
								layer.msg(d.msg, {icon: 1});
								setTimeout(tzym,2000);
							} else {
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg(d.msg, {icon: 2});
							}
						});
					}
					return false;


				},
				commit:function(data) {
					$('#btnsave').addClass("layui-btn-disabled").attr("disabled",true);
					$('#btnsubmit').addClass("layui-btn-disabled").attr("disabled",true);
					var istg=_crt_page.events.saveBefore(data);
					if(istg){
						var url='/supplier/projectManager/updateSave?flag=1';
						if(data.field.jlFwMoney && Number(data.field.jlFwMoney)<=0){
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('金额不正确', {icon: 2});return false;
						}
						if(data.field.zxFwMoney && Number(data.field.zxFwMoney)<=0){
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('金额不正确', {icon: 2});return false;
						}
						if(data.field.jcFwMoney && Number(data.field.jcFwMoney)<=0){
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('金额不正确', {icon: 2});return false;
						}
						if(data.field.qtFwMoney && Number(data.field.qtFwMoney)<=0){
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('金额不正确', {icon: 2});return false;
						}
						if (data.field.tzMoney && Number(data.field.tzMoney)<0){
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('金额不正确', {icon: 2});return false;
						}
						if (data.field.htMoney && Number(data.field.htMoney)<=0){
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('金额不正确', {icon: 2});return false;
						}
						var sum = data.field.htMoney;
						var fwMoney = Number(data.field.jlFwMoney) + Number(data.field.zxFwMoney) + Number(data.field.jcFwMoney) + Number(data.field.qtFwMoney);
						if (sum != fwMoney) {
							// console.log("合同金额："+sum+"服务金额："+fwMoney);
							$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
							$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
							layer.msg('请填写正确的合同金额，合同金额应该等于所有类型服务费之和', {icon: 2});return false;
						}
						layerAjax(url, data.field, '', function (d) {
							if (d.flag == true) {
								layer.msg("提交成功，请耐心等待平台审核", {icon: 1});
								setTimeout(tzym,2000);
							} else {
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);

								layer.msg(d.msg, {icon: 2});
							}
						});
					}
					return false;
				}

			},
			events: {
				_init: function () {
					form.on('submit(save)', _crt_page.forms.create);
					form.on('submit(submit)', _crt_page.forms.submit);
					_crt_page.events.gqdateInit();
					_crt_page.events.uploadInit();
					_crt_page.events.lxInit();
					//_crt_page.events.oaCheckInit();
				},
				oaCheckInit: function(){
					var oaProjInfo = '${oaProjInfo}';
					if(oaProjInfo){
						var oaProjInfoObj = JSON.parse(oaProjInfo);
						console.log('oaProjInfoObj');
						console.log(oaProjInfoObj);
						//合同类型:
						if(oaProjInfoObj.htlx != undefined && oaProjInfoObj.htlx != ''){
							$('.xmlxdiv input[type="checkbox"]').attr('disabled', 'disabled');
						}
						//是否已签合同
						if(oaProjInfoObj.ywht != undefined && oaProjInfoObj.ywht != ''){
							$(".LIqdHt").find("input[type='radio']").prop('disabled', 'disabled');
						}
						//合同签订日期:
						if(oaProjInfoObj.htqdrq != undefined && oaProjInfoObj.htqdrq != ''){
							$("#htSignDate").attr("disabled", "disabled");
						}
						//项目名称
						if(oaProjInfoObj.xmmc != undefined && oaProjInfoObj.xmmc != ''){
							$("#projectName").attr("readonly", "readonly");
						}
						//投资额
						if(oaProjInfoObj.xmtze != undefined && oaProjInfoObj.xmtze != ''){
							$("#tzMoney").attr("readonly", "readonly");
						}
						//合同金额
						if(oaProjInfoObj.htje != undefined && oaProjInfoObj.htje != ''){
							$("#htMoney").attr("readonly", "readonly");
						}
						//监理费
						if(oaProjInfoObj.jlf != undefined && oaProjInfoObj.jlf != ''){
							$("#jlFwMoney").attr("readonly", "readonly");
						}
						//咨询费
						if(oaProjInfoObj.zxf != undefined && oaProjInfoObj.zxf != ''){
							$("#zxFwMoney").attr("readonly", "readonly");
						}
						//检测费
						if(oaProjInfoObj.jcf != undefined && oaProjInfoObj.jcf != ''){
							$("#jcFwMoney").attr("readonly", "readonly");
						}
					}
				},
				gqdateInit: function () {
					// 工期开始时间
					laydate.render({
						elem: '#gqBeginDate',
						trigger: 'click',
						done: function (value, date) {
							var that = $(this.elem[0])
							console.log(that);
							var  endDate=$("#gqEndDate").val();
							if(endDate  && endDate<value){
								layer.msg("开始时间不能大于结束时间", {icon: 2});
								$(that).val("");
								return ;
							}
						}
					});
					// 工期截止时间
					laydate.render({
						elem: '#gqEndDate',
						trigger: 'click',
						done: function (value, date) {
							var that = $(this.elem[0])
							console.log(that);
							var  startDate=$("#gqBeginDate").val();
							if(startDate  && startDate>value){
								layer.msg("结束时间不能小于开始时间", {icon: 2});
								$(that).val("");
								return ;
							}
						}
					});
					// 招标截止时间
					laydate.render({
						elem: '#zbEndDate',
						trigger: 'click',
						type:'datetime',
						format: 'yyyy-MM-dd HH:mm'
					});
					// 合同签订时间
					laydate.render({
						elem: '#htSignDate',
						trigger: 'click'
					});
					// 预计进场时间
					laydate.render({
						elem: '#ydyjjcTime',
						trigger: 'click',
					});

					// 引见时间
					laydate.render({
						elem: '#yjTime',
						trigger: 'click',
					});
				},
				uploadInit: function () {
					var tempFileIds = [];
					$.each($('.file-upload'), function (i, e) {
						//绑定一个个上传文件:
						var fileDataStr = $(e).attr('filedata');
						//至少fileData中需要有文件的类型编码
						var fileData = eval('(' + fileDataStr + ')');
						var fileContainer = $(e).parents(".upload_oper_div").next();
						var type = fileData.type;
						var ext = '';
						// if (type == '311') {
						// 	//书著文件,只能上传文档
						// 	ext = 'doc|docx';
						// } else if (type == '312') {
						// 	//扫描件,只能上传pdf
						// 	ext = 'doc|docx';
						// } else if (type == '313') {
						// 	ext = 'doc|docx';
						// } else if (type == '314') {
						// 	ext = 'pdf';
						// } else if (type == '315') {
						// 	ext = 'doc|docx';
						// }
						//上传组件参数自定义:
						var uploadPara = {
							elem: $(e),
							accept: 'file',
							temp: "1",
							exts: ext,
							before: function (res) {
								this.data = fileData;
							},
							done: function (res) {
								if (res.flag) {
									var newFileId = res.data.id;
									var type = res.data.type + '';
									var newIndex = $('.form-file-div').length * 1;
									layer.msg("上传成功", {icon: 1});
									$(e).parent().find(".upfinish").removeClass("layui-btn-disabled").attr("disabled", false);
									$(fileContainer).append("    <li class=\"clearfix form-file-div form-file-div-" + type + "\">" +
											"                            <input type=\"checkbox\" class=\"fl\"  style=\"display: inline-block;\" lay-ignore>\n" +
											"                            <span class=\"fl ml10\"><span class=\"cursor\" id=\""+res.data.id+"\" url=\""+res.data.url+"\" onclick=\"_crt_file.events.viewFile(this)\">" + res.data.fileName + "</span></span>\n" +
											'                            <input type="hidden" class="' + type + '-input" name="tempFormFileIds[' + newIndex + ']" value="' + newFileId + '" />' +
											"                        </li>");
								} else {
									layer.msg(res.msg, {icon: 2})
								}
							},
							container: fileContainer
							// fileOrder: 'desc'
						};
						_form_file.upload.bind(uploadPara);
					})
				},
				lxInit:function(){
					$(".xmlxdiv").find("[type='checkbox']").each(function (i,v) {
						var lxvalue=$(v).attr("value");
						if($(v).prop("checked")){
							$(".lx"+lxvalue).attr("style","display:block;")
							$(".lx"+lxvalue).find("input").attr("lay-verify","required|decimal|maxlength")
						}else{
							$(".lx"+lxvalue).attr("style","display:none;")
							$(".lx"+lxvalue).find("input").removeAttr("lay-verify");
							$(".lx"+lxvalue).find("input").val("");
						}
					});
				},
				finishfile:function(object){
					var length = $(object).parents(".uploadli").find("ul").find("li").length;
					if(length==0){
						layer.msg("请上传文件",{icon:2})
						return ;
					}

					var fileDataStr =$(object).parent().find(".file-upload ").attr('filedata');
					//至少fileData中需要有文件的类型编码
					var fileData = eval('(' + fileDataStr + ')');
					var  finishId=fileData.type+"finish";
					$("#"+finishId).val("1");
					layer.msg("操作成功",{icon:1});

				},
				delFile:function(object){
					var checkbox = $(object).parents(".uploadli").find("ul").find("li").find("input:checked");
					if (checkbox.length == 0) {
						layer.msg("请选择文件", {icon: 2});
						return;
					}
					var ids = [];
					checkbox.each(function (i, v) {
						var _a = $(v).val();
						ids.push(_a);
					});
					console.log(ids)
					var ids = ids.join(',');
					console.log(ids)
					layer.confirm('确定删除文件吗？', function (index) {
						layerAjax('/supplier/deleteFile', {"ids": ids}, '', function (d) {
							if(d.flag){
								checkbox.each(function (i, v) {
									$(v).parent().remove();
								});
								layer.msg("删除成功！");
							}else{
								layer.msg(d.msg, {icon: 2});
							}
						});
					});

				},
				saveBeforeBjy: function (data) {
					var isTg = true;
					var lxlength = $(".xmlxdiv").find("[type='checkbox']:checked").length;
					if (lxlength == 0) {
						$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
						$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
						layer.msg("请选择项目类型", {icon: 2});
						isTg = false;
						return isTg;
					}
					var lxsz = [];
					$(".xmlxdiv").find("[type='checkbox']:checked").each(function (i, v) {
						var lxvalue = $(v).attr("value");
						lxsz.push(lxvalue);
					});

					lxsz = lxsz.join(',');
					data.field.projectType = lxsz;
					var dobest = [];
					$(".doBestInput:checked").each(function (i, v) {
						var value = $(v).attr("value");
						dobest.push(value);
					});
					dobest = dobest.join(',');
					data.field.mainFzField = dobest;
					if (!data.field.needZb) {
						data.field.needZb = "";
					}
					if (!data.field.isZb) {
						data.field.isZb = "";
					}
					if (!data.field.qdHt) {
						data.field.qdHt = "";
					}
					if (!data.field.isSfk) {
						data.field.isSfk = "";
					}
					return isTg;
				},
				saveBefore:function(data){
					var isTg = true;
					var lxlength= $(".xmlxdiv").find("[type='checkbox']:checked").length;
					if(lxlength==0){
						$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
						$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
						layer.msg("请选择项目类型", {icon: 2});
						isTg=false;
						return isTg;
					}
					var gklength= $(".divisgk").find("[type='radio']:checked").length;
					if(gklength==0){
						$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
						$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
						layer.msg("请选择是否对外公开", {icon: 2});
						isTg=false;
						return isTg;
					}

					var zbchecklenght=$(".divneedzb").find("[type='radio']:checked").length;
					if(zbchecklenght==0){
						$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
						$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
						layer.msg("请选择是否需要招投标", {icon: 2});
						isTg=false;
						return isTg;
					}else{
						if($(".divneedzb").find("[type='radio']:checked").attr("value")=="1"){
							var zbchecklenght=$(".LIisZb").find("[type='radio']:checked").length;
							if(zbchecklenght==0){
								$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
								$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
								layer.msg("请选择是否已招标", {icon: 2});
								isTg=false;
								return isTg;
							}else{
								var isZb= $(".LIisZb").find("[type='radio']:checked").attr("value");
								if(isZb=="1"){
									var htchecklenght=$(".LIqdHt").find("[type='radio']:checked").length;
									if(htchecklenght==0){
										$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
										$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
										layer.msg("请选择是否已签合同", {icon: 2});
										isTg=false;
										return isTg;
									}else{
										var  issdHt=  $(".LIqdHt").find("[type='radio']:checked").attr("value");
										if(issdHt=="1"){
											var sfkchecklenght=$(".sfk").find("[type='radio']:checked").length;
											if(sfkchecklenght=="0"){
												$('#btnsave').removeClass("layui-btn-disabled").attr("disabled",false);
												$('#btnsubmit').removeClass("layui-btn-disabled").attr("disabled",false);
												layer.msg("请选择是否有首付款", {icon: 2});
												isTg=false;
												return isTg;
											}
										}

									}

								}

							}
						}
					}
					var  lxsz=[];
					$(".xmlxdiv").find("[type='checkbox']:checked").each(function (i,v) {
						var lxvalue=$(v).attr("value");
						lxsz.push(lxvalue);
					});

					lxsz = lxsz.join(',');
					data.field.projectType=lxsz;
					var  dobest=[];
					$(".doBestInput:checked").each(function (i,v) {
						var value=$(v).attr("value");
						dobest.push(value);
					});
					dobest = dobest.join(',');
					data.field.mainFzField=dobest;
					if(!data.field.needZb){
						data.field.needZb="";
					}
					if(!data.field.isZb){
						data.field.isZb="";
					}
					if(!data.field.qdHt){
						data.field.qdHt="";
					}
					if(!data.field.isSfk){
						data.field.isSfk="";
					}
					return isTg;


				},
				ssfybulur:function(object){
					var ssfy=$(object).val();
					var ssblper='${ssblper}';
					if(ssfy){
						var  fwfy=(ssfy*ssblper).toFixed(2);
						$(object).parent().next().find("input").val(fwfy);
					}

				},
				xmlxChange:function(object){
					var lxvalue=  $(object).attr("value");
					if($(object).prop("checked")){
						$(".lx"+lxvalue).attr("style","display:block;")
						$(".lx"+lxvalue).find("input").attr("lay-verify","required|decimal|maxlength")
					}else{
						$(".lx"+lxvalue).attr("style","display:none;")
						$(".lx"+lxvalue).find("input").removeAttr("lay-verify");
						$(".lx"+lxvalue).find("input").val("");
					}
				},
				needZtbChange:function(object){
					var lxvalue=  $(object).attr("value");
					if($(object).prop("checked")  && lxvalue=='1'  ){
						$(".LIisZb").css({"display":"block","width":"60%"});
						$(".upload_zbtzs_li").css({"display": "block"});
					} else {
						// 是否招标不显示
						$(".LIisZb").attr("style", "display:none;");
						$(".LIisZb").find("input").prop('checked', false);
						$(".upload_zbtzs_li").attr("style", "display:none;");
						$(".upload_zbtzs_li").find("input").prop('checked', false);
						/*             $(".LIqdHt").attr("style","display:none;")
                                     $(".LIqdHt").find("input").prop('checked',false);
                                     $(".sfk").attr("style","display:none;")
                                     $(".sfk").find("input").prop('checked',false);
                                     $(".htqdhj").attr("style","display:none;")
                                     $(".htqdhj").find("input").val("");*/
					}
					_crt_page.events.radioChange();

				},
				isZbChange:function(object){
					var lxvalue=  $(object).attr("value");
					if($(object).prop("checked")  && lxvalue=='1'  ){
						$(".LIqdHt").css({"display":"block","width":"60%"});
						$(".LIqdHt").find("input").prop('disabled',false);
					}else{
						//是否已签合同（默认“否”，不可修改）
						$(".LIqdHt").css({"display":"block","width":"60%"});
						$(".LIqdHt").find("input").prop('checked',true);
						$(".LIqdHt").find("input").prop('disabled',true);

						$(".sfk").attr("style","display:none;")
						$(".sfk").find("input").prop('checked',false);
						$(".htqdhj").attr("style","display:none;")
						$(".htqdhj").find("input").val("");
					}
					_crt_page.events.radioChange();
				},
				qdHtChange:function(object){
					var lxvalue=  $(object).attr("value");
					if($(object).prop("checked")  && lxvalue=='1'  ){
						$(".sfk").css({"display":"block","width":"60%"});
						$(".htqdhj").css({"display":"block","width":"60%"});
						$(".htqdhj").find("input").attr("lay-verify","required")
					}else{
						$(".sfk").attr("style","display:none;")
						$(".sfk").find("input").prop('checked',false);
						$(".htqdhj").find("input").removeAttr("lay-verify")
						$(".htqdhj").attr("style","display:none;")
						$(".htqdhj").find("input").val("");
					}
					_crt_page.events.radioChange();
				},
				radioChange:function(){
					// (1) ，则显示 “上传项目招标文件”、“上传项目投标文件”、“上传合同


					var ztb= $(".divneedzb").find("[type='radio']:checked").attr("value");
					var iszb= $(".LIisZb").find("[type='radio']:checked").attr("value");
					var qdht= $(".LIqdHt").find("[type='radio']:checked").attr("value");
					if(ztb=="1"  && iszb=="1"   && qdht=="1"  ){
						//  则显示 “上传项目招标文件”、“上传项目投标文件”、“上传合同”。
						$(".upload_zbwj_li").css('display','block');
						$(".upload_tbwj_li").css('display','block');
						$(".upload_ht_li").css('display','block');


						$(".upload_zbwjsmw_li").find("ul").find("li").remove();
						$(".upload_htsmwj_li").find("ul").find("li").remove();
						$(".upload_zbwjsmw_li").css('display', 'none');
						$(".upload_htsmwj_li").css('display', 'none');
					}
					if(ztb=="1"  && iszb=="1"   && qdht=="0"  ){
						//  则显示 “上传项目招标文件”、“上传项目投标文件”、“上传合同”。
						$(".upload_zbwj_li").css('display','block');
						$(".upload_tbwj_li").css('display','block');
						$(".upload_htsmwj_li").css('display','block');


						$(".upload_zbwjsmw_li").find("ul").find("li").remove();
						$(".upload_ht_li").find("ul").find("li").remove();
						$(".upload_zbwjsmw_li").css('display', 'none');
						$(".upload_ht_li").css('display', 'none');

					}
					if(ztb=="1"  && iszb=="0"   && qdht=="0"  ){
						//  “上传项目招标文件说明文件”、“上传合同说明文件”
						$(".upload_zbwjsmw_li").css('display','block');
						$(".upload_htsmwj_li").css('display','block');


						$(".upload_zbwj_li").find("ul").find("li").remove();
						$(".upload_tbwj_li").find("ul").find("li").remove();
						$(".upload_ht_li").find("ul").find("li").remove();
						$(".upload_zbwj_li").css('display', 'none');
						$(".upload_tbwj_li").css('display', 'none');
						$(".upload_ht_li").css('display', 'none');
					}
					if(ztb=="0"    && qdht=="1"  ){
						//  “上传项目招标文件说明文件”、“上传合同说明文件”
						$(".upload_ht_li").css('display','block');


						$(".upload_zbwjsmw_li").find("ul").find("li").remove();
						$(".upload_htsmwj_li").find("ul").find("li").remove();
						$(".upload_zbwj_li").find("ul").find("li").remove();
						$(".upload_tbwj_li").find("ul").find("li").remove();
						$(".upload_zbwjsmw_li").css('display', 'none');
						$(".upload_htsmwj_li").css('display', 'none');
						$(".upload_zbwj_li").css('display', 'none');
						$(".upload_tbwj_li").css('display', 'none');
					}
					if(ztb=="0"    && qdht=="0"  ){
						//  “上传项目招标文件说明文件”、“上传合同说明文件”
						$(".upload_htsmwj_li").css('display','block');

						$(".upload_zbwj_li").find("ul").find("li").remove();
						$(".upload_tbwj_li").find("ul").find("li").remove();
						$(".upload_ht_li").find("ul").find("li").remove();
						$(".upload_zbwjsmw_li").find("ul").find("li").remove();

						$(".upload_zbwj_li").css('display', 'none');
						$(".upload_tbwj_li").css('display', 'none');
						$(".upload_ht_li").css('display', 'none');
						$(".upload_zbwjsmw_li").css('display', 'none');
					}

				},
				provinceChange:function(object){
					var code = $(object).find('option:selected').val();
					if (code == "") {
						return;
					}
					layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
						if (d.flag == true) {
							$(object).next().empty().append("<option value=''>选择市</option>");
							for (var i = 0; i < d.data.length; i++) {
								$(object).next().append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
							}
						} else {
							layer.msg(d.msg, {icon: 2});
						}
					});


				},
				cityChange:function(object){
					var code = $(object).find('option:selected').val();
					if (code == "") {
						return;
					}
					layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
						if (d.flag == true) {
							$(object).next().empty().append("<option value=''>选择区县</option>");
							for (var i = 0; i < d.data.length; i++) {
								$(object).next().append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
							}
						} else {
							layer.msg(d.msg, {icon: 2});
						}
					});


				},
				personPlaceProvinceInit:function(){
					$(".mainpersonplace").find("div").each(function (i,v) {
						var provinceId=$(v).find("select:first").attr("id");
						var cityId=$(v).find("select:eq(1)").attr("id");
						$("#"+provinceId).change(function () {
							var code = $('#'+provinceId+' option:selected').val();
							if (code == "") {
								return;
							}
							layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
								if (d.flag == true) {
									$("#"+cityId).empty().append("<option value=''>选择市</option>");
									for (var i = 0; i < d.data.length; i++) {
										$("#"+cityId).append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
									}
								} else {
									layer.msg(d.msg, {icon: 2});
								}
							});

						});
					});
				},
				placeCityInit:function(){
					$(".ssplace").find("div").each(function (i,v) {
						var cityId=$(v).find("select:eq(1)").attr("id");
						var countyId=$(v).find("select:eq(2)").attr("id");
						$("#"+cityId).change(function () {
							var code = $('#'+cityId+' option:selected').val();
							if (code == "") {
								return;
							}
							layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
								if (d.flag == true) {
									$("#"+countyId).empty().append("<option value=''>选择区县</option>");
									for (var i = 0; i < d.data.length; i++) {
										$("#"+countyId).append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
									}
								} else {
									layer.msg(d.msg, {icon: 2});
								}
							});

						});
					});

				},
				resetPlace:function(){
					/*  $(".ssplace").find(".addplaceimage:not(:last)").attr("style","display:none;")*/
					$(".ssplace").find(".divplaceselect").each(function (i,v) {
						$(v).find("select:eq(0)").attr("name","projectPlacedtos["+i+"].province")
						$(v).find("select:eq(1)").attr("name","projectPlacedtos["+i+"].city");
						$(v).find("select:eq(2)").attr("name","projectPlacedtos["+i+"].county");
						$(v).find("select:eq(0)").attr("lay-filter","projectPlacedtos["+i+"].province");
						$(v).find("select:eq(1)").attr("lay-filter","projectPlacedtos["+i+"].city");
						$(v).find("select:eq(2)").attr("lay-filter","projectPlacedtos["+i+"].county");
					});
				},
				resetPersonPlace:function(){
					/*  $(".ssplace").find(".addplaceimage:not(:last)").attr("style","display:none;")*/
					$(".mainpersonplace").find(".divpersonplaceselect").each(function (i,v) {
						$(v).find("select:eq(0)").attr("name","personPlacedtos["+i+"].province")
						$(v).find("select:eq(0)").attr("lay-filter","personPlacedtos["+i+"].province");
						$(v).find("select:eq(1)").attr("name","personPlacedtos["+i+"].city");
						$(v).find("select:eq(1)").attr("lay-filter","personPlacedtos["+i+"].city");

					});
				},
				deletePlace:function(object){
					var placeLength=$(".ssplace").find(".divplaceselect").length;
					if(placeLength==1){
						layer.msg("实施地点不能全部删除", {icon: 2});
					}else{
						$(object).parent().remove();
						_crt_page.events.resetPlace();
					}

				},
				addPlace:function(object){
					$(object).parent().after(" <div class=\"clearfix mt10 divplaceselect\">\n" +
							"                            <select name=\"projectPlacedtos[1].province\" class=\"ml8 fl\" id=\"placeprovince1\"   onchange=\"_crt_page.events.provinceChange(this)\"  style=\"width:90px !important;\"\n" +
							"                                    lay-verify=\"required\" lay-ignore>\n" +
							"                                <option value=\"\">请选择</option>\n" +
							"                                <#list provincelist as vo>\n" +
							"                                    <option value=\"${vo.code}\">${vo.name}</option>\n" +
							"                                </#list>\n" +
							"                            </select>\n" +
							"                            <select name=\"projectPlacedtos[1].city\" id=\"placecity1\" class=\"ml8 fl\"  onchange=\"_crt_page.events.cityChange(this)\" lay-filter=\"projectPlacedtos[1].city\" lay-verify=\"required\"\n" +
							"                                    style=\"width: 90px !important;margin-left: 10px\" lay-ignore>\n" +
							"                                <option value=\"\">请选择</option>\n" +
							"                            </select>\n" +
							"                            <select name=\"projectPlacedtos[1].county\" id=\"placecounty1\" class=\"ml8 fl\" lay-filter=\"projectPlacedtos[1].county\" lay-verify=\"required\"\n" +
							"                                    style=\"width:90px !important;margin-left: 10px\" lay-ignore>\n" +
							"                                <option value=\"\">请选择</option>\n" +
							"                            </select>\n" +
							"                            <img src=\"${re.contextPath}/plugin/common/images/77@2x.png\" class=\"fl ml20 addplaceimage\" onclick=\"_crt_page.events.addPlace(this)\" >\n" +
							"                            <img src=\"${re.contextPath}/plugin/common/images/76@2x.png\" class=\"fl ml20\" onclick=\"_crt_page.events.deletePlace(this)\">\n" +
							"                        </div>");
					_crt_page.events.resetPlace();

				},
				addPersonPlace:function (object) {
					$(object).parent().after("\n" +
							"                        <div class=\"clearfix mt10 divpersonplaceselect\">\n" +
							"                            <select name=\"personPlacedtos[0].province\" class=\"ml8 fl\"   onchange=\"_crt_page.events.provinceChange(this)\" id=\"personplaceprovince0\" style=\"width:200px !important;\"\n" +
							"                                    lay-verify=\"required\" lay-ignore>\n" +
							"                                <option value=\"\">请选择</option>\n" +
							"                                <#list provincelist as vo>\n" +
							"                                    <option value=\"${vo.code}\">${vo.name}</option>\n" +
							"                                </#list>\n" +
							"                            </select>\n" +
							"                            <select name=\"personPlacedtos[0].city\" id=\"personplacecity0\" class=\"ml8 fl\" lay-filter=\"city\" lay-verify=\"required\"\n" +
							"                                    style=\"width: 200px !important;margin-left: 10px\" lay-ignore>\n" +
							"                                <option value=\"\">请选择</option>\n" +
							"                            </select>\n" +
							"                            <img src=\"${re.contextPath}/plugin/common/images/77@2x.png\" class=\"fl ml20\" onclick=\"_crt_page.events.addPersonPlace(this)\">\n" +
							"                            <img src=\"${re.contextPath}/plugin/common/images/76@2x.png\" class=\"fl ml20\" onclick=\"_crt_page.events.deletePersonPlace(this)\">\n" +
							"                        ");
					_crt_page.events.resetPersonPlace();
				},
				deletePersonPlace:function (object) {
					var placeLength=$(".mainpersonplace").find(".divpersonplaceselect").length;
					if(placeLength==1){
						//清空地点
						$(".mainpersonplace").find(".divpersonplaceselect").find("select").val("");
						//layer.msg("地点不能全部删除", {icon: 2});
					}else{
						$(object).parent().remove();
						_crt_page.events.resetPersonPlace();
					}

				}

			}
		};
		_crt_page.init();
	});
	function resetRequired() {

		if("${project.status}" == "001"){
			form.verify({
				required: function(v){
				}
			})
		}
	}

	function resetRequiredSubmit() {
		form.verify({
			required: function (v) {
				if (v == "") {
					return "必填项不能为空";
				}
			}
		})
	}
	function tzym(){
		var supProjectId = $("#supProjectId").val();
		var projectName = $("#projectName").val();
		window.parent._delTab("xm_v"+supProjectId);
		window.parent._showtab('xm_v' + supProjectId, '查看-' +projectName, '/supplier/projectManager/projectDetail?type=v&supProjectId=' +supProjectId);
		window.parent._delTabT('xm_e'+supProjectId);
	}


</script>
</body>

</html>
